#define off_t long
#define _syscall3(type, name, atype a, btype, b, ctype c) 
type name(atype a, btype b, ctype c) 
{   long  __res; \
    __asm__ volatile(
        "int 0x80"
        :"=a"(__res)      /* "=a"(__res)表明输出__res = %eax，*/
        :""(__NR_##name), /*""(__NR_##name)表明输入movl __NR_##name, %eax */
        "b"((long)(a)),   /* 输入: movl a, %ebx，a即为atype a */
        "c"((long)(b)),   /* 输入: movl b, %ecx，b即为btype b */
        "d"((long)(c))
        );  /* 输入: movl c, %edx，c即为ctype c */
    if (__res >= 0) 
        return (type)__res; 
    errno = -__res; 
    return -1; 
}

/* 0ff_t表示文件偏移量，一般是long类型 */
int write(int fd, const char *buf, off_t count)
{
    long __res;
    __asm__ volatile("int 0x80":"=a"(__res):""(__NR_##write),  /* 在32位CPU中宏__NR_write等于4，64为CPU中__NR_write等于1 */
    "b"((long)(fd)), 
    "c"((long)(buf)), 
    "d"((long)(count)));
    ......
}
